<table class="formTable">
<tbody>
	<tr>
		<th class="must">提供機能</th>
		<td class="labels">
			<ul id="plugins" class="btns b10">
				<li class="btn left c"><a href="javascript:;">全てチェック</a></li>
				<li class="btn right c"><a href="javascript:;">全て外す</a></li>
			</ul>
			{foreach item=p key=name from=$plugin}
			
				{if $p.id < 990}
					{assign var=tpl value=$p.code|cat:'/include/module_container.inc.html'}
					{if $p.id != '' && file_exists($template_dir[0]|cat:$tpl)}
					<label><input type="checkbox" name="forms[plugin][]" value="{$p.id}" {if $p.id|in_array:$forms.plugin}checked="checked"{/if}>
					<img src="" />{$p.name}</label>
					{else}
						<label><input type="checkbox" name="forms[plugin][]" value="{$p.id}" {if $p.id|in_array:$forms.plugin}checked="checked"{/if}>
						3<img src="" />{$p.name}</label>
					{/if}
				{/if}
			{/foreach}
			{assign var=key value='plugin'}
			{if isset($err[$key])}{$validate->getMessages($err[$key]) nofilter}{/if}
		</td>
	</tr>
</tbody>
</table>
<script type="text/javascript">
$('#plugins .left a').click(function(){
	$('.labels input[type=checkbox]').each(function(){
		if(!$(this).attr('checked')){
			$(this).closest("label").click();
		}
	});
});

$('#plugins .right a').click(function(){
	$('.labels input[type=checkbox]').each(function(){
		if($(this).attr('checked')){
			$(this).closest("label").click();
		}
	});
})
</script>
